<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">
<h:head>
    <title>Login</title>
    <h:graphicImage id="loginlogo" alt="Logo" url="images/braunschweig.jpg">
    </h:graphicImage>
</h:head>
<h:body>
    <h:form>
        <p:growl id="growl" showDetail="true" life="5000" autoUpdate="true" />
        <h:panelGrid columns="2" cellpadding="5">
            <h:outputLabel for="username" value="Username:" />
            <p:inputText value="#{loginBean.username}" id="username" required="true" label="username" />

            <h:outputLabel for="password" value="Password:" />
            <h:inputSecret value="#{loginBean.password}" id="password" required="true" label="password" />

            <f:facet name="footer">
                <p:commandButton id="loginButton" value="Login" update="growl" action="#{loginBean.login}" />
            </f:facet>
        </h:panelGrid>
    </h:form>
    <h:form>

        <p:commandButton id="pwRecovery" value="Password vergessen" onclick="dlg.show()" />
        <p:dialog header="Bitte E-Mail angeben" widgetVar="dlg" resizable="false">
            <h:panelGrid columns="2" style="margin-bottom:10px">
                <h:outputLabel for="firstname" value="E-Mail:" />
                <p:inputText id="firstname" value="#{loginBean.pwRecoveryEMail}" />
            </h:panelGrid>
            <p:commandButton id="submitButton" value="Absenden" onclick="dlg.hide();"
                actionListener="#{loginBean.pwRecovery}" />
        </p:dialog>
    </h:form>
</h:body>
</html>